////////////////////////////////////////////////////////////////////////////
/// Name: droid.h
/// Author: B. Gian James <gian@BattleDroids.net>
/// Description: The definitions and declaration of the BattleDroid
///
/// $Id: droid.h,v 1.2 2009/08/28 22:55:17 gian Exp $
////////////////////////////////////////////////////////////////////////////
#include "common.h"
#include "pilot.h"
#include "equipment.h"
#include "weapons.h"

typedef struct _sig
{
	uint8	sig;
	uint8	lvl;
	_sig *	next;
	
} Signature;

class BattleDroid
{
public:
	BattleDroid();
	BattleDroid(const BattleDroid &);
	
	uint8		Init();
	void		Save();
		
private:
	char 		_name[15];
	Pilot	  * _pilot;

	uint8		_ver;	// [1..35]
	uint16		_xp;	// experience [0..65500]
	uint8		_verminor;	// upgrades
	uint8		_armor;		// how much dmg can you take
	
	// Basic statistics  [0..200]
	uint8		_energy;		// everything takes energy
	uint8		_mobility;		// how quickly you move and evade
	uint8		_computation;	// how quickly you compute
	uint8		_communication;	// how efficient are your comms?
	uint8		_damageControl;	// how well can you fix your damage?
	uint8		_class;			// how big are you?
	
	// derived statistics
	uint8		_weight;		// how much you weigh?
	///////// other derived stats are taken care of by the host software
	uint8		_defense;
	uint8		_initiative;
	
	// classic saving throws
	uint8		_explosive;		// save against exploding
	uint8		_emi;			// save against EMI failure
	uint8		_mechanical;	// save against mechanical failure
	
	Signature	_signature;		// your stealth signature
	
	uint16		_id;			// droid's ID
	
	DroidEquipment	_equipment;	// droid equipment
	DroidWeapon		_weapons;	// droid weapons
	
	
};

///////////////////////////// Droid Locations
#define MOUNT_LSHOULDER	0x01
#define MOUNT_RSHOULDER	0x02
#define MOUNT_LARM		0x04
#define MOUNT_RARM		0x08
#define MOUNT_CHASSIS	0x10
#define MOUNT_BACK		0x20
#define MOUNT_INTERNAL	0x40
#define MOUNT_HEAD		0x80

///////////////////////////// Droid Signatures
#define SIG_RADAR		0x01
#define SIG_THERMAL		0x02
#define SIG_SONAR		0x04
#define SIG_VISUAL		0x08
#define SIG_ALL			(SIG_RADAR & SIG_THERMAL & SIG_SONAR & SIG_VISUAL)


///////////////////////////// EEPROM config location
////// Initial Config Info
#define EE_VERSION		0x01				// uint8	
#define EE_AUTOUPDATE	(EE_VERSION + 1)	// uint8

////// Identification
#define EE_CHKSUM		0x10				// uint16
#define EE_DROID_ID		(EE_CHKSUM + 16)	// uint16

////// Droid Statistics
#define EE_DROID_STATS	0x30
